#pragma once

#include "State.h"
#include "Port_Global.h"
#include "ResourceManager.h"
#include "GraphicsUtil.h"

class Portfolio
{
public:
	Portfolio();

	void setupAllegro();

	void startGUI();

	ResourceManager *getRMgr()
	{
		return rMgr;
	}

	GraphicsUtil *getGUtil()
	{
		return gUtil;
	}

	static void ticker();

	static void game_time_ticker();

	static volatile int ticks;

	void changeState(State *newState);

	void cleanUp();

	void exitRenderLoop()
	{
		quit = true;
	}
private:
	void actualStateChange();

	const int updates_per_second;
	
	static volatile int game_time;

	GraphicsUtil *gUtil;

	ResourceManager *rMgr;

	State *currentState;

	State *nextState;

	bool quit;

	bool stateChanged;
};